package com.wm.blog.center.common.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

/**
 * @Author: weiming
 * @Date: 2021/5/18 13:48
 * @Description:
 */
@Aspect
@Component
public class LoginAdvice {

    //任意返回类型 任意包及子孙包下的Controller结尾的类的方法
    @Before(value = "@annotation(com.wm.blog.center.common.annotation.NeedLogin)")
    public void myBefore(JoinPoint joinPoint){
        System.out.println("匹配NeedLogin");
        joinPoint.getTarget();
    }

}
